$(document).ready(function(){ 
  var chart = echarts.init($('#doc-statUploadByDays-chart').get(0));
  chart.showLoading({
    text: "图表数据正在努力加载..."
  });
  var options = {
      tooltip : {
          trigger: 'axis'
      },
      legend: {
          data:["日上传数"]
      },
      toolbox: {
          show : true,
          feature : {
              //mark : {show: true},
              //dataView : {show: true, readOnly: false},
              magicType : {show: true, type: ['line', 'bar']},
              restore : {show: true}
          }
      },
      calculable : true,
      grid : {
        x: 30,
        x2: 10,  
        y: 30,
        y2:30
      },
      xAxis : [
          {
              type : 'category',
              data : []
          }
      ],
      yAxis : [
          {
              type : 'value',
              splitArea : {show : true}
          }
      ],
      series : [
//          {
//              name:'蒸发量',
//              type:'bar',
//              data:[2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3]
//          },
//          {
//              name:'降水量',
//              type:'bar',
//              data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]
//          }
      ]
  };
  
  $.webtools.ajax({
    isShowLoading: false,
    url: __CONTEXT_PATH+"/oa/shareFile/statUploadCountByDays.json",
    params: {"days":30},
    success: function(reply) {
      //options.legend.data = "日上传数";
      options.xAxis[0].data = reply.categories;
      options.series.push(reply.series);
      chart.hideLoading();
      chart.setOption(options);
      
    }
  });   
  
  
});